package com.wayhome.srpingbootmybatis.utils;

import com.wayhome.srpingbootmybatis.constant.BusinessConst;
import org.springframework.util.StringUtils;

public class BaseUtil {

    public static boolean judeInsuAdmdvs(String code1,String code2){
        if(StringUtils.isEmpty(code1) || StringUtils.isEmpty(code2)){
            return false;
        }
        // 如果code1或者code2是特殊地区,判断六位是不是相等
        if (BusinessConst.XINJI_CODE.equals(code1) ||
                BusinessConst.DINGZHOU_CODE.equals(code1) ||
                BusinessConst.HUAYOU_CODE.equals(code1) ||
                BusinessConst.SHITIE_CODE.equals(code1) ||
                BusinessConst.DIANLI_CODE.equals(code1) ||
                BusinessConst.SBJ_CODE.equals(code1) ||
                BusinessConst.XINJI_CODE.equals(code2) ||
                BusinessConst.DINGZHOU_CODE.equals(code2) ||
                BusinessConst.HUAYOU_CODE.equals(code2) ||
                BusinessConst.SHITIE_CODE.equals(code2) ||
                BusinessConst.DIANLI_CODE.equals(code2) ||
                BusinessConst.SBJ_CODE.equals(code2)){
            return code1.equals(code2);
        }
        return code1.substring(0,4).equals(code2.substring(0,4));
    }
}
